package com.adou.second.file;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Random;

/**
 * 
 * @author Administrator
 *
 */
public class DianMing {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new FileReader("fos\\dianming.txt"));
		ArrayList<String> mings = new ArrayList<String>();
		
		String line = null;
		while((line = br.readLine()) != null){
			mings.add(line);
		}
		br.close();
		
		Random r = new Random();
		int index = r.nextInt(mings.size());
		String name = mings.get(index);
		System.out.println("幸运者是：" + name);
		
		
		
		
		
		
		
		
		
		
		
	}

}
